from django.db import models
from utils.basemodel import BaseModel


# Create your models here.
class NavModel(BaseModel):
    name = models.CharField(max_length=20, verbose_name='导航名称')
    location = models.BooleanField(default=False, verbose_name='导航位置')
    link = models.CharField(max_length=100, verbose_name='导航链接', blank=True, null=True)
    sort = models.IntegerField(default=0, verbose_name='导航排序')

    def __str__(self):
        return self.name

    class Meta:
        db_table = 'nav'


class BannerModel(BaseModel):
    is_http= models.BooleanField(default=True, verbose_name='是否是http')
    image = models.CharField(max_length=100, verbose_name='轮播图')
    link = models.CharField(max_length=100, verbose_name='轮播图链接')
    sort = models.IntegerField(default=0, verbose_name='轮播图排序')

    def __str__(self):
        return self.image

    class Meta:
        db_table = 'banner'